home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / drdobbs / 1987 / 11 / breeden.lst next >
File List  |  1987-10-08  |  35KB  |  685 lines

  1. Listing 1
  2.  
  3. Screen # 0
  4.  
  5. \                                            jbb 15:47 08/04/87 
  6.                                                                 
  7.                          GETIMAGE                               
  8.                                                                 
  9.                                                                 
  10.              Copyright 1987, All Rights Reserved                
  11.                                                                 
  12.                             by                                  
  13.                      J. Brooks Breeden                          
  14.                       Columbus, Ohio                            
  15.                       August 4, 1987                            
  16.                                                                 
  17.            Loads an EGAPAINT file into video memory             
  18.        from within UR/FORTH for subsequent animation, etc.      
  19.                                                                 
  20.                                                                 
  21.  
  22.  
  23. Screen # 1
  24.  
  25. \ Misc.                                      jbb 13:01 08/04/87 
  26. DOSINT                            \ fetch level 2 DOS interface 
  27. HCB IMAGEHCB                      \ create the handle block     
  28. CREATE PALTAB  16 ALLOT           \ to hold egapaint's palette  
  29.                                                                 
  30. : ?MEMREQ ( x1 y1 x2 y2 - bytes)  \ calc. memory req to @BLOCK  
  31.    ROT - 1+  -ROT SWAP - 1+ 2/ 1+  *  4 + ;                     
  32.                                                                 
  33. HEX                                                             
  34. : RESTORE-EGA ( - )         \ restore EGA's default mode:       
  35.    2 3C4 PC!  0F 3C5 PC!    \ default map mask                  
  36.    3 3CE PC!   0 3CF PC!    \ default data rotate reg value     
  37.    5 3CE PC!   0 3CF PC!    \ default write mode 0              
  38.    8 3CE PC!  FF 3CF PC! ;  \ default bit mask                  
  39. DECIMAL                                                         
  40. -->                                                             
  41.  
  42.  
  43. Screen # 2
  44.  
  45. \ EGA map mask control                       jbb 15:37 08/04/87 
  46.                                                                 
  47. HEX                                                             
  48.                                                                 
  49. : READMODE0 ( - )   5 3CE PC!  8 3CF PC! 2 3CE PC! 0 3CF PC! ;  
  50.                                                                 
  51.           \ set map-masks to select active EGA color bit-planes 
  52. : BLUEPLANE    ( - ) 2 3C4 PC!  1 3C5 PC! ; \ plane 0           
  53. : GREENPLANE   ( - ) 2 3C4 PC!  2 3C5 PC! ; \ plane 1           
  54. : REDPLANE     ( - ) 2 3C4 PC!  4 3C5 PC! ; \ plane 2           
  55. : INTENSEPLANE ( - ) 2 3C4 PC!  8 3C5 PC! ; \ plane 3           
  56.                                                                 
  57. DECIMAL                                                         
  58. -->                                                             
  59.                                                                 
  60.                                                                 
  61.  
  62.  
  63. Screen # 3
  64.  
  65. \ File control                               jbb 12:59 08/04/87 
  66.                                                                 
  67. : OPENIMAGEFILE ( ^filename - )                                 
  68.    IMAGEHCB NAME>HCB                    \ force filename        
  69.    IMAGEHCB O_RD FOPEN                  \ open file for reading 
  70.    IF ABORT" Can't open file." THEN ;                           
  71.                                                                 
  72. : CLOSEIMAGEFILE ( - )  IMAGEHCB FCLOSE DROP ;                  
  73.                                                                 
  74. : MAKEIMAGEFILE ( ^filename - )                                 
  75.    IMAGEHCB NAME>HCB                    \ force filename        
  76.    IMAGEHCB 0 FMAKE                     \ make "normal" file    
  77.    IF ABORT" Can't make file." THEN ;                           
  78. -->                                                             
  79.                                                                 
  80.                                                                 
  81.  
  82.  
  83. Screen # 4
  84.  
  85. \ Read EGAPAINT file from disk to video      jbb 15:45 08/04/87 
  86.                                                                 
  87. \ To load EGAPAINT disk image into EGA video segment...         
  88. \ set map mask, read bytes from disk, repeat for each plane     
  89.                                                                 
  90. : READBYTES ( - )     \ read  28,000 bytes to video segment     
  91.    IMAGEHCB  ?VSEG 0  \ source=handle; dest.= videoseg:offset   
  92.    28000 FREADL       \ read 28,000 bytes                       
  93.    DROP ;             \ drop flag.                              
  94.                                                                 
  95. : READPAINTFILE ( - ) \ read all four planes in sequence...     
  96.      BLUEPLANE  READBYTES  REDPLANE READBYTES                   
  97.      GREENPLANE READBYTES  INTENSEPLANE READBYTES ;             
  98. -->                                                             
  99.                                                                 
  100.                                                                 
  101.  
  102.  
  103. Screen # 5
  104.  
  105. \                                            jbb 15:44 08/04/87 
  106.                                                                 
  107. : LOADPAINTFILE ( ^filename - )                                 
  108.    640X350 VMODE  CLS            \ hi-res 16-color              
  109.    OPENIMAGEFILE                 \ Open the file, and           
  110.    IMAGEHCB PALTAB 16 FREAD      \ read palette data.           
  111.      IF PALTAB !PALETTE          \ If read was successful,      
  112.       THEN                       \ set palette to new colors.   
  113.    READMODE0                     \ Set read mode 0 and          
  114.    READPAINTFILE                 \ read the bit-plane data.     
  115.    CLOSEIMAGEFILE                \ Close the file, and          
  116.    RESTORE-EGA ;                 \ restore the EGA defaults.    
  117. -->                                                             
  118.                                                                 
  119.                                                                 
  120.                                                                 
  121.  
  122.  
  123. Screen # 6
  124.  
  125. \ Load the EGAPAINT full-screen image        jbb 15:17 08/04/87 
  126.                                                                 
  127. CREATE BARON  ,C" THEFOKKR.IMG"  \ orig 112K EGAPAINT disk file 
  128. CREATE FOKKER ,C" DERFOKKR.IMG"  \ new smaller @BLOCK disk file 
  129. CREATE DR.1   3072 ALLOT         \ memory req as multiple of 8  
  130.                                                                 
  131. : SAVEDR.1    1 1 106 53  DR.1 @BLOCK ;   \ get block to memory 
  132.                                                                 
  133. : GETIMAGE BARON LOADPAINTFILE SAVEDR.1 ; \ get orig image>mem  
  134.                                                                 
  135. : SAVEFOKKER   FOKKER MAKEIMAGEFILE  \ build .img file on disk  
  136.    IMAGEHCB PALTAB 16 FWRITE DROP    \ include pallete info     
  137.    IMAGEHCB DR.1 2904 FWRITE DROP    \ write DR.1 mem to disk   
  138.    CLOSEIMAGEFILE ;                  \ close it out...          
  139. -->                                                             
  140.                                                                 
  141.  
  142.  
  143. Screen # 7
  144.  
  145. \ CHECKOUT  JUNK                             jbb 16:07 08/04/87 
  146.                                                                 
  147. : CK1  HR DR.1 267 148 !BLOCK                                   
  148.        277 156 361 192 FRAME          \ Fokker image limits     
  149.        LTBLUE FG                                                
  150.        267 148 372 200 FRAME          \ image area saved        
  151.        262 143 272 153 FRAME          \ hit zone around CORNER  
  152.        314 165 324 175 FRAME ;        \ hit zone on Fokker      
  153.                                                                 
  154. : GUNSIGHT ( - )   ORANGE FG  269 170 369 170 LINE              
  155.    319 133 319 274 LINE  319 170 50 circle ;                    
  156.                                                                 
  157. : CK  CK1  GUNSIGHT ;                                           
  158.                                                                 
  159.                                                                 
  160.                                                                 
  161.  
  162.  
  163.  
  164.  
  165.  
  166. Listing 2
  167.  
  168.  
  169.  
  170.             Listing 2.  Pseudocode to move a full 112,000 byte image
  171.             from the disk to the screen:  NOTE:  ALL NUMBERS HEXIDECIMAL
  172.             
  173.             Set the video mode to graphics mode xx however your language
  174.             does it.
  175.             
  176.             Open the file using a DOS handle however your language does
  177.             it.
  178.             
  179.             If palette data is the first data in the file,
  180.             Then read the palette data and set the new palette.  (This
  181.             should be covered in your language's high level routines.)
  182.             
  183.             Set read mode 0
  184.             Write  5 to port 3CE, then
  185.             write  8 to port 3CF, then
  186.             write  2 to port 3CE, then
  187.             write  0 to port 3CF.
  188.             
  189.             Set map mask to plane 0 (blue plane)
  190.             Write  2 to port 3C4, then
  191.             write  1 to port 3C5.
  192.             
  193.             Read 28,000 bytes from the file to A000:0000 however your
  194.             language does it.
  195.             
  196.             Set map mask to plane 2 (red plane)
  197.             Write 2 to port 3C4, then
  198.             write 4 to port 3C5.
  199.             
  200.             Read 28,000 bytes from the file to A000:0000 however your
  201.             language does it.
  202.             
  203.             Set map mask to plane 1 (green plane)
  204.             Write 2 to port 3C4, then
  205.             write 4 to port 3C5.
  206.             
  207.             Read 28,000 bytes from the file to A000:0000 however your
  208.             language does it.
  209.             
  210.             Set map mask to plane 3 (intensity plane)
  211.             Write  2 to port 3C4, then
  212.             write  8 to port 3C5.
  213.             
  214.             Read 28,000 bytes from the file to A000:0000 however your
  215.             language does it.
  216.             
  217.             Close the file, however your language does it.
  218.             
  219.             Restore EGA default values.
  220.             (set map mask default: all planes active)
  221.             Write  2 to port 3C4, then
  222.             write 0F to port 3C5.
  223.             
  224.  
  225.  
  226.  
  227.  
  228.  
  229.             (set data rotate register default)
  230.             Write  3 to port 3CE, then
  231.             write  0 to port 3CF.
  232.             
  233.             (set default write mode 0)
  234.             Write  5 to port 3CE, then
  235.             write  0 to port 3CF.
  236.             
  237.             (set default bit-mask)
  238.             Write  8 to port 3CE, then
  239.             write FF to port 3CF.
  240.  
  241.  
  242.  
  243.  
  244.  
  245. Listing 3
  246.  
  247. Screen # 0
  248.  
  249. \                                            jbb 17:28 07/04/87 
  250.                                                                 
  251.                        FOKKER.SCR                               
  252.               A Mindless Game of Motor Skill                    
  253.              (somewhere over the trenches...)                   
  254.                                                                 
  255. NOTE: YOU ABSOLUTELY MUST HAVE CRUISE CONTROL, OR SOME OTHER    
  256.       KIND OF KEYBOARD SPEEDUP SOFTWARE FOR THIS TO WORK !!!    
  257.                                                                 
  258.                      Standard Version                           
  259.           Copyright (C) 1987, All Rights Reserved               
  260.                                                                 
  261.                             by                                  
  262.                      J. Brooks Breeden                          
  263.                                                                 
  264.              EGAGRAPH.EXE must be loaded first                  
  265.  
  266.  
  267. Screen # 1
  268.  
  269. \ File control...                            jbb 13:08 08/04/87 
  270. \ this screen is required to load image initially.              
  271. \ For turnkey, the image is in memory & this scr isn't required 
  272.                                                                 
  273.  DOSINT                             \ level 2 DOS interface     
  274.                                                                 
  275. HCB IMAGEHCB                       \ create the handle block    
  276.                                                                 
  277. : OPENIMAGEFILE ( ^filename - )                                 
  278.    IMAGEHCB NAME>HCB               \ force filename             
  279.    IMAGEHCB O_RD FOPEN             \ open file for reading      
  280.    IF ABORT" Can't open file." THEN ;                           
  281.                                                                 
  282. : CLOSEIMAGEFILE  ( -- )                                        
  283.    IMAGEHCB FCLOSE DROP ;          \ close, ignore status       
  284. -->                                                             
  285.  
  286.  
  287. Screen # 2
  288.  
  289. \ File control...                            jbb 09:49 08/01/87 
  290.                                                                 
  291. CREATE DR.1   3000 ALLOT            \ to hold the bit map image 
  292. CREATE PALTAB   16 ALLOT            \ new palette of colors     
  293. CREATE FOKKERIMG ,C" DERFOKKR.IMG"  \ name of the image file    
  294.                                                                 
  295. : GETFOKKER             \ load binary image from disk to memory 
  296.    DR.1 3000 ERASE                  \ clean out memory area     
  297.    FOKKERIMG OPENIMAGEFILE          \ open 'er up               
  298.    IMAGEHCB PALTAB 16 FREAD DROP    \ read in palette info      
  299.    IMAGEHCB DR.1 2866 FREAD  DROP   \ read in the image         
  300.    CLOSEIMAGEFILE ;                 \ close the file            
  301.                                                                 
  302. GETFOKKER        \ load the Fokker image during the compile...  
  303. -->              \ Note: Obviously, you'd better have the image 
  304.                  \ file in your directory at this point!        
  305.  
  306.  
  307. Screen # 3
  308.  
  309. \ Pallette colors                            jbb 17:10 08/02/87 
  310.                                                                 
  311. : FG   FOREGROUND ;                \  shorthand for LMI's words 
  312. : BG   BACKGROUND ;                                             
  313. : HR   640X350 VMODE ;             \ high res EGA 16-color mode 
  314.                                                                 
  315. \ Named colors for the EGAPAINT default pallette                
  316. 0 CONSTANT BLACK      8 CONSTANT GREEN                          
  317. 1 CONSTANT DKGRAY     9 CONSTANT LTGREEN                        
  318. 2 CONSTANT GRAY      10 CONSTANT CYAN                           
  319. 3 CONSTANT DKRED     11 CONSTANT LTBLUE                         
  320. 4 CONSTANT RED       12 CONSTANT BLUE                           
  321. 5 CONSTANT ORANGE    13 CONSTANT DKBLUE                         
  322. 6 CONSTANT YELLOW    14 CONSTANT PURPLE                         
  323. 7 CONSTANT DKGREEN   15 CONSTANT WHITE                          
  324. -->                                                             
  325.  
  326.  
  327. Screen # 4
  328.  
  329. \ Utilities                                  jbb 09:53 08/01/87 
  330.                                                                 
  331. : TAB ( row col - )  SWAP  GOTOXY ;          \ clearer for text 
  332. : ?   @ . ;                                                     
  333.                  \ returns unique IBM keycode for each keypress 
  334. : MYKEY ( - n)   KEY DUP 0= IF DROP KEY 128 + THEN ;            
  335.                                                                 
  336. : WAIT ( - )   MYKEY  DROP ;              \ wait for a keypress 
  337. \ vector math...                                                
  338. : V+ ( a b c d --- a+c b+d)   >R ROT + SWAP R> + ;              
  339. : V* ( a b c d --- a*c b*d)   >R ROT * SWAP R> * ; \ not used;  
  340. : V/ ( a b c d --- a/c b/d)   >R ROT / SWAP R> / ; \ for info.. 
  341.                                                                 
  342. : S-LINE ( row - )   0 TAB  80 0 DO 196 EMIT LOOP ; \ a line    
  343. : D-LINE ( row - )   0 TAB  80 0 DO 205 EMIT LOOP ; \ dbl. line 
  344. -->                                                             
  345.  
  346.  
  347. Screen # 5
  348.  
  349. \ Random number generator                    jbb 09:56 08/01/87 
  350.                                                                 
  351. VARIABLE SEED                                                   
  352. @TIME COMBINE SEED !                \ plant seed w/system clock 
  353.                                                                 
  354. : random ( - n )                              \ 0 <= n <= 32767 
  355.    SEED @ 259 * 3 + 32767 AND  DUP SEED ! ;                     
  356.                                                                 
  357. : RANDOM ( n1 - n2 )                             \ 0 <= n2 < n1 
  358.    random M* 32768 UM/MOD NIP ;                                 
  359.                                                                 
  360. : BETWEEN  ( lo# hi# - inbetween#)   OVER - RANDOM + ;          
  361.                                                                 
  362. : WITHIN? ( n hi# lo# - flag)   >R 1- OVER < SWAP R> < AND ;    
  363. -->                                                             
  364.                                                                 
  365.  
  366.  
  367. Screen # 6
  368.  
  369. \ Fokker movement                            jbb 14:44 08/06/87 
  370.                                                                 
  371. 2VARIABLE CORNER    \ xy-coords of up-left corner of fokker box 
  372.                                                                 
  373. -1 1 2EQU RANGE               \ range of random fokker movement 
  374.                                                                 
  375.            \ add to Baron's excitement by bumping allowed RANGE 
  376. : EXCITEMENT ( - )   RANGE -1 1 V+ 2EQU RANGE ;                 
  377.                                                                 
  378.    \ leaves random x and y within RANGE by which to move Fokker 
  379. : MOVEFOKKER ( - n n)   RANGE BETWEEN RANGE BETWEEN ;           
  380.                                                                 
  381. : GUNSIGHT ( - )   ORANGE FG  269 170 369 170 LINE              
  382.    319 133 319 274 LINE  319 170 50 circle ;                    
  383. -->                                                             
  384.                                                                 
  385.  
  386.  
  387. Screen # 7
  388.  
  389. \ Stick control                              jbb 10:05 08/01/87 
  390.                                                                 
  391.                   \ set gunsight movement based on #key pressed 
  392. : ?stick ( adr - adr n n)  MYKEY                                
  393.        CASE 199 OF  2 -2 ENDOF    200 OF  0 -2 ENDOF            
  394.             201 OF -2 -2 ENDOF    205 OF -2  0 ENDOF            
  395.             209 OF -2  2 ENDOF    208 OF  0  2 ENDOF            
  396.             207 OF  2  2 ENDOF    203 OF  2  0 ENDOF            
  397.       ( otherwise)  0  0           \ leave 0's for V+ to add... 
  398.             ROT                    \ move index to top of stack 
  399.       ENDCASE  ;                   \ for ENDCASE to drop...     
  400.                                                                 
  401. : ?STICK ( adr - adr n n) ?TERMINAL   \ key pressed?            
  402.    IF  ?stick                         \ check stick control     
  403.    ELSE  0 0  THEN ;                  \ leave zeros for "V+"    
  404. -->                                                             
  405.  
  406.  
  407. Screen # 8
  408.  
  409. \ Exclamations!                              jbb 10:12 08/01/87 
  410.                                                                 
  411. \ These aren't real serious curses; you make up your own!       
  412. CREATE CURSES ," Dankeschoen!        Welkommen!          Wie Geh
  413. ts?          Was ist das?        Weiner Schnitzel!   Bratwurst! 
  414.          Sauerbrauten!       Knockwurst!         Sauerkraut!    
  415.      Weisswurst           "                                     
  416.                                                                 
  417. : EXCLAMATION      \ shout a curse at the user, for distraction 
  418.    3 30 TAB CLREOL  3 33 TAB ORANGE FG                          
  419.    10 RANDOM 20 * CURSES + 20  -TRAILING TYPE ;                 
  420. -->                                                             
  421.                                                                 
  422.                                                                 
  423.                                                                 
  424.                                                                 
  425.  
  426.  
  427. Screen # 9
  428.  
  429. \  Damage report                             jbb 10:14 08/01/87 
  430.                                                                 
  431. VARIABLE #HITS                      \ # of hits in cockpit zone 
  432. VARIABLE AMMO                       \ rounds of ammunition left 
  433.                                                                 
  434. : .HITS   GRAY FG 22 44 TAB #HITS ? ;    \ print out number of  
  435. : .AMMO   GRAY FG 23 44 TAB AMMO  ? ;     \ hits & ammo left.   
  436.                                                                 
  437. : HIT?   CORNER 2@ 143 153 WITHIN? \ y in hit zone?             
  438.    SWAP 262 272 WITHIN?  AND       \ x in hit zone?  Both?      
  439.    IF 2 #HITS +! .HITS             \ Increment hits & show #.   
  440.      #HITS @ 4 MOD 0=              \ For every 4 hits, increase 
  441.      IF EXCITEMENT  EXCLAMATION    \ movement & display curse!  
  442.      THEN                                                       
  443.    THEN ;                                                       
  444. -->                                                             
  445.  
  446.  
  447. Screen # 10
  448.  
  449. \  Shooting...                               jbb 10:19 08/01/87 
  450.                                                                 
  451. : 2SHOTS   219 349 319 170 LINE 419 349 320 170 LINE ;          
  452.                                                                 
  453. : FIREGUNS     \ fire two shots, decrement ammo, show ammo left 
  454.    WHITE FG  2SHOTS                                             
  455.    5000 0 DO  LOOP   \ kill some time                           
  456.    DKBLUE FG  2SHOTS  -2 AMMO +! .AMMO ;                        
  457.                                                                 
  458. : SHOOTING?   ?TERMINAL         \ If there is keyboard input... 
  459.    IF MYKEY 32 =                \ was it the spacebar?          
  460.      IF AMMO @                  \ Yes, if we have any ammo,     
  461.        IF FIREGUNS HIT? THEN    \ shoot & check if we hit the   
  462.      THEN                       \ Fokker.                       
  463.    THEN ;                                                       
  464. -->                                                             
  465.  
  466.  
  467. Screen # 11
  468.  
  469. \ Explosion                                  jbb 15:01 08/04/87 
  470.                                                                 
  471. : BURST   320 0   \ random dots expanding in all four quadrants 
  472.    DO 319 I RANDOM + 174 I RANDOM - !PEL                        
  473.       319 I RANDOM + 174 I RANDOM + !PEL                        
  474.       319 I RANDOM - 174 I RANDOM + !PEL                        
  475.       319 I RANDOM - 174 I RANDOM - !PEL LOOP  ;                
  476.                                                                 
  477. : EXPLODE   3 0 DO  BURST  LOOP ;   \ it pulses the bursts...   
  478.                                                                 
  479. HEX                   \ clear bios buffer of waiting keypresses 
  480. : CLR-KEY-BUF    0C01 regAX ! 21 INT86 ;                        
  481. DECIMAL                                                         
  482.                                                                 
  483. : WAIT-FOR-ESC   CLR-KEY-BUF  BEGIN  MYKEY 27 =  UNTIL ;        
  484. -->                                                             
  485.  
  486.  
  487. Screen # 12
  488.  
  489. \ Win message                                jbb 17:35 07/04/87 
  490.                                                                 
  491. : WIN                     \ what happens if you shoot him down! 
  492.    WHITE FG EXPLODE  DKBLUE FG REVERSE  ORANGE FG 6 14 TAB      
  493.    ."  What a pilot!  You downed the baron with "               
  494.    100 AMMO @ - .  ." rounds. "                                 
  495.    7 14 TAB                                                     
  496.    ."  Now it's time to head for home and celebrate.       "    
  497.    20 25 TAB                                                    
  498.    ."  Press ESC to go home in GLORY. " GRAY FG REVERSE         
  499.    WAIT-FOR-ESC ;                                               
  500. -->                                                             
  501.                                                                 
  502.                                                                 
  503.                                                                 
  504.                                                                 
  505.  
  506.  
  507. Screen # 13
  508.  
  509. \ Lose message                               jbb 10:20 08/01/87 
  510.                                                                 
  511. : LOSE            \ what happens if you DON'T shoot him down... 
  512.    DKBLUE FG REVERSE  ORANGE FG 6 14 TAB                        
  513.    ."  You are a rotten pilot!  You waste ammunition, and "     
  514.    7 14 TAB                                                     
  515.    ."  let yourself get outflown by the bloody Red Baron. "     
  516.    8 14 TAB                                                     
  517.    ."  Tuck your tail beween your legs and head for home. "     
  518.    20 23 TAB                                                    
  519.    ."  Now press ESC to go home in SHAME! "                     
  520.    DKBLUE FG REVERSE  GRAY FG  WAIT-FOR-ESC ;                   
  521. -->                                                             
  522.                                                                 
  523.                                                                 
  524.                                                                 
  525.  
  526.  
  527. Screen # 14
  528.  
  529. \ Setup                                      jbb 10:22 08/01/87 
  530.                                                                 
  531. F: FOKKER                              \ forward reference      
  532.                                                                 
  533. : SETUP   HR PALTAB !PALETTE CLS       \ use EGAPaint palette   
  534.     DKBLUE BG  GUNSIGHT                \ paint sky and gunsight 
  535.    -1 1 2EQU RANGE                     \ fokker motion range    
  536.    175 375 BETWEEN  104 254 BETWEEN    \ random starting points 
  537.    CORNER 2!  0 #HITS !  100 AMMO !    \ setup the variables    
  538.    GRAY FG                                                      
  539.    22 34 TAB ." # OF HITS: " .HITS      \ show hits             
  540.    23 34 TAB ." AMMO LEFT: " .AMMO ;    \ show ammo             
  541. -->                                                             
  542.                                                                 
  543.                                                                 
  544.                                                                 
  545.  
  546.  
  547. Screen # 15
  548.  
  549. \ Major loop                                 jbb 10:23 08/01/87 
  550.                                                                 
  551. : DOGFIGHT   SETUP                  \ get ready...              
  552.    BEGIN  DR.1                      \ address of fokker bitmap  
  553.      CORNER 2@ MOVEFOKKER V+        \ +random movement          
  554.      ?STICK V+      ( --- adr x y)  \ +stick control            
  555.      2DUP CORNER 2! !BLOCK          \ update corner; show plane 
  556.      SHOOTING?  #HITS @ 19 >        \ check hits in pilot zone  
  557.        IF WIN  EXIT THEN            \ blow up plane; you win.   
  558.      AMMO @ 0=                      \ out of ammo?              
  559.        IF LOSE EXIT THEN            \ you lose...               
  560.      GUNSIGHT                       \ redisplay gunsight        
  561.    AGAIN  ;                                                     
  562. -->                                                             
  563.                                                                 
  564.                                                                 
  565.  
  566.  
  567. Screen # 16
  568.  
  569. \ Options                                    jbb 10:23 08/01/87 
  570.                                                                 
  571. : D-LINES                                                       
  572.    B/W CLS PURPLE FG 7 D-LINE 19 D-LINE RED FG ; \ double lines 
  573.                                                                 
  574. : .OPTIONS    D-LINES                                           
  575.     6  0 TAB ." Fokker" 6 36 TAB ." OPTIONS"    LTBLUE FG       
  576.    11 31 TAB ." F1.  " GRAY FG ." Instructions" LTBLUE FG       
  577.    13 31 TAB ." F2.  " GRAY FG ." Play"         LTBLUE FG       
  578.    15 31 TAB ." F10. " GRAY FG ." Exit"                         
  579.    20 0 TAB ;                                                   
  580. -->                                                             
  581.                                                                 
  582.                                                                 
  583.                                                                 
  584.                                                                 
  585.  
  586.  
  587. Screen # 17
  588.  
  589. \ Credits                                    jbb 13:25 07/31/87 
  590.                                                                 
  591. : .CREDITS    D-LINES  6 36 TAB ." FOKKER"  LTBLUE FG 8 23 TAB  
  592.    ." (A Mindless Game of Motor Skill)"  11 20 TAB  RED FG      
  593.    ." Somewhere over the trenches in France..."                 
  594.    GRAY FG 14 22 TAB                                            
  595.    ." Copyright 1987, All Rights Reserved" 15 38 TAB ." by "    
  596.    16 32 TAB ." J. Brooks Breeden" 17 32 TAB ." Columbus, Ohio" 
  597.     ORANGE FG  20 26 TAB ." Press Any Key to Continue..."       
  598.    23 11 TAB LTBLUE FG                                          
  599.    ." Written in UR/FORTH from Laboratory Microsystems, Inc."   
  600.    24  9 TAB                                                    
  601.  ." Fokker Dr.1 created with EGAPAINT from RIX Softworks, Inc." 
  602.   ;                                                             
  603. -->                                                             
  604.                                                                 
  605.  
  606.  
  607. Screen # 18
  608.  
  609. \ Help...                                    jbb 13:24 07/31/87 
  610.                                                                 
  611. : HELP1   B/W CLS RED FG  1 20 TAB ." Your Mission:"            
  612.    PURPLE FG 2 S-LINE  LTBLUE FG  3 20 TAB                      
  613.    ." Your mission is to down the Red Baron with 20 hits"       
  614.    4 20 TAB                                                     
  615.    ." in the cockpit area of his Fokker Dr.1 triplane."         
  616.    5 20 TAB                                                     
  617.    ." When you shoot, the Baron gets excited, and takes"        
  618.    6 20 TAB                                                     
  619.    ." evasive action.  You have 100 rounds of ammo left,"       
  620.    7 20 TAB                                                     
  621.    ." and your guns have a tendency to jam..." ;                
  622. -->                                                             
  623.                                                                 
  624.                                                                 
  625.  
  626.  
  627. Screen # 19
  628.  
  629. \ Help...                                    jbb 13:21 07/31/87 
  630.                                                                 
  631. : HELP2   RED FG  9 20 TAB                                      
  632.    ." To play..."  PURPLE FG 10 S-LINE LTBLUE FG  11 20 TAB     
  633.    ." The cursor keys control the gunsight like a joystick."    
  634.    12 20 TAB                                                    
  635.    ." The up arrow key pushes the stick forward.  The down"     
  636.    13 20 TAB                                                    
  637.    ." arrow key pulls back on the stick.  Left, right, and"     
  638.    14 20 TAB                                                    
  639.    ." diagonal keys move the stick as you would expect."        
  640.    16 20 TAB                                                    
  641.    ." Fire by holding down the space bar."                      
  642.    21 20 TAB                                                    
  643.    ." Press Ctrl-Break to quit at any time." ;                  
  644. -->                                                             
  645.  
  646.  
  647. Screen # 20
  648.  
  649. \ Warning...                                 jbb 10:24 08/01/87 
  650.                                                                 
  651. : WARNING    D-LINES  6 34 TAB ." WARNING!!!" LTBLUE FG         
  652.     9 20 TAB ." YOU ABSOLUTELY MUST HAVE CRUISE CONTROL,"       
  653.    10 20 TAB ." QUICKEYS, OR OTHER TSR KEYBOARD SPEED-UP"       
  654.    11 20 TAB ." RESIDENT IN ORDER TO RUN THIS PROGRAM !!!"      
  655.    13 20 TAB ." If you do not have a keyboard speed-up"         
  656.    14 20 TAB ." program resident, press Ctrl-Break to exit."    
  657.    16 20 TAB ." If a keyboard speed-up program is resident..."  
  658.    ORANGE FG  20 26 TAB ." Press Any Key to Continue..."        
  659.    WAIT ;                                                       
  660.                                                                 
  661. : .HELP   HELP1 HELP2  ORANGE FG  23 26 TAB                     
  662.    ." Press Any Key to Continue..."  WAIT FOKKER ;              
  663. -->                                                             
  664.                                                                 
  665.  
  666.  
  667. Screen # 21
  668.  
  669. \ Main resolved                              jbb 10:24 08/01/87 
  670.                                                                 
  671. : INTRO   CLS B/W  .CREDITS WAIT  20 0 TAB CLREOL ;             
  672.                                                                 
  673. R: FOKKER .OPTIONS MYKEY     \ resolve FOKKER forward reference 
  674.    CASE  187 OF .HELP FOKKER ENDOF        \ show instructions   
  675.          188 OF  DOGFIGHT  FOKKER ENDOF   \ do the dogfight     
  676.          196 OF  BYE  ENDOF               \ exit to DOS         
  677.          DROP FOKKER                      \ recurse to options  
  678.    ENDCASE ;                                                    
  679.                                                                 
  680.                                                                 
  681. : MAIN   HR PALTAB !PALETTE WARNING INTRO FOKKER ;              
  682.                                                                 
  683.                                                                 
  684. 
  685.